package cn.edu.csust.cvs.management.service;

import cn.edu.csust.cvs.management.common.ApiPageResult;
import cn.edu.csust.cvs.management.common.ApiResponse;
import cn.edu.csust.cvs.management.common.ApiResult;
import cn.edu.csust.cvs.management.common.PageQueryRequest;
import cn.edu.csust.cvs.management.controller.request.*;
import cn.edu.csust.cvs.management.repository.entity.VideoEntity;
import cn.edu.csust.cvs.management.service.domain.Video;
import cn.edu.csust.cvs.management.service.domain.VideoClip;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * @Auther: snail
 * @Date: 2021/2/1 00:30
 * @Description: 视频管理服务接口
 */
public interface VideoService {

    /**
     * 批量上传文件
     * @param multipartFile
     * @return
     */
    ApiResponse upload(MultipartFile multipartFile);

    /**
     * 删除视频
     * @param request
     * @return
     */
    ApiResponse delete(VideoDeleteRequest request);

    /**
     * 查询视频详情
     * @param id
     * @return
     */
    ApiResult<Video> detail(Integer id);

    /**
     * 视频分页查询
     * @param request
     * @return
     */
    ApiPageResult<List<VideoEntity>> pageQuery(VideoPageQueryRequest request);

    /**
     * 视频片段分页查询
     * @param videoId
     * @param request
     * @return
     */
    ApiPageResult<List<VideoClip>> pageQuery(Integer videoId, PageQueryRequest request);

    /**
     * 固定时长切分
     * @param request
     * @return
     */
    ApiResponse segmentByFix(VideoFixSegmentRequest request);

    /**
     * 自由时长切分
     * @param request
     * @return
     */
    ApiResponse segmentByFlexible(Integer id, VideoFlexibleSegmentRequest request);

    /**
     * 语音提取
     * @return
     */
    ApiResponse extract(SpeechExtractRequest request);

    /**
     * 语音转文本
     * @param speechId
     * @return
     */
    ApiResult<String> stt(Integer speechId);

    /**
     * 文本转语音
     * @param speechId
     * @param text
     * @return
     */
    ApiResponse tts(Integer speechId,String text);

    /**
     * 语音合成
     * @param request
     * @return
     */
    ApiResponse composite(SpeechCompositeRequest request);

    /**
     * 语音合成
     * @param request
     * @return
     */
    ApiResponse composite(RecordCompositeRequest request);

    /**
     * 视频合并
     * @param videoId
     * @return
     */
    ApiResponse merge(Integer videoId);
}
